From ec8deab9df116e31ecdc221de9f348b265e71c8a Mon Sep 17 00:00:00 2001 From: "sos22@douglas.cl.cam.ac.uk" Date: Fri, 3 Jun 2005 11:22:37 +0000 Subject: [PATCH] bitkeeper revision 1.1661 (42a03d7dMwgNdNW-UfchOZEUQsYy9w) Make sure we only look at the unpinned list for mms which are actually unpinned. Signed-off-by: Steven Smith --- linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c index 675509e0be..363010f1ed 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c @@ -134,9 +134,11 @@ void destroy_context(struct mm_struct *mm) kfree(mm->context.ldt); mm->context.size = 0; } - spin_lock(&mm_unpinned_lock); - list_del(&mm->context.unpinned); - spin_unlock(&mm_unpinned_lock); + if (!mm->context.pinned) { + spin_lock(&mm_unpinned_lock); + list_del(&mm->context.unpinned); + spin_unlock(&mm_unpinned_lock); + } } static int read_ldt(void __user * ptr, unsigned long bytecount) -- 2.30.2